/**
 * Standard JavaScript Library
 *
 * LICENSE
 *
 * This source file is subject to the sjl Public License license that
 * is bundled with this package in the file LICENSE.txt.
 *
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @copyright Copyright (c) 2008, Danny Graham, Scott Thundercloud
 */
Namespace("com.sjl");
com.sjl.DOMParser=Class.create();
com.sjl.DOMParser.inherits("com.sjl.EventDispatcher");
com.sjl.DOMParser.prototype.initialize=function(){
};
com.sjl.DOMParser.prototype.parseDOM=function(_1){
var _2=(_1)?_1:document;
var _3=function(_4,_5){
var _6=_5.getAttribute("namedargs")||false;
var _7=[];
var _8=_5.childNodes;
if(_8.length){
for(var i=0;i<_8.length;i++){
var _a=(document.all)?_8.item(i):_8[i];
if(_a.nodeName=="LI"&&typeof _a.firstChild!="undefined"&&typeof _a.firstChild.nodeValue!="undefined"){
if(_6){
var _b=_a.getAttribute("name");
_7.push(_b+":\""+_a.firstChild.nodeValue+"\"");
}else{
_7.push("\""+_a.firstChild.nodeValue+"\"");
}
}
}
}
var _c=(_6)?"{"+_7.join(",")+"}":_7.join(",");
var _d=eval("new "+_4+"("+_c+");");
var _e=_5.parentNode;
_e.replaceChild(_d,_5);
};
var _f=[];
_f=document.getElementsByAttribute(_2,"div","parseas");
_f=_f.concat(document.getElementsByAttribute(_2,"button","parseas"));
var _10=[];
var _11=[];
for(var i=0;i<_f.length;i++){
var _13=_f[i].getAttribute("parseas");
if(!com.sjl.io.ResourceLoader.GetInstance().IsLoaded(_13)){
_10.push(Array(_13,_f[i]));
_11.push(_13);
}else{
_3(_13,_f[i]);
}
}
var _14=this;
var e={};
e.oncomplete=function(p){
com.sjl.io.ResourceLoader.GetInstance().removeListener("oncomplete",e);
for(var i=0;i<_10.length;i++){
_3(_10[i][0],_10[i][1]);
}
_14.dispatch({type:"oncomplete"});
};
com.sjl.io.ResourceLoader.GetInstance().addListener("oncomplete",e);
Import(_11);
};
com.sjl.DOMParser.__instance=null;
com.sjl.DOMParser.GetInstance=function(){
if(com.sjl.DOMParser.__instance==null){
com.sjl.DOMParser.__instance=new com.sjl.DOMParser();
}
return com.sjl.DOMParser.__instance;
};

